#ifndef __IPATH_PLANNER_H_INCLUDE__
#define __IPATH_PLANNER_H_INCLUDE__

#include <irrlicht.h>
#include <list>
#include "SparseGraph.h"
#include "GraphNode.h"
#include "GraphEdge.h"
#include "Graph_SearchAStar.h"
#include "Heuristic_Euclid.h"

using namespace irr;
using namespace core;

class IPathPlanner
{
private:
	typedef SparseGraph<NavGraphNode<void*>, GraphEdge> NavGraph;
	
private:
	std::list<int> m_Path;
	NavGraph* m_pGraph;
	
	double m_dCostToTarget;
	double m_dCellWidth;
	double m_dCellHeight;
	int m_iCellsX;
    int m_iCellsY;
	
	int m_iSourceCell;
	int m_iTargetCell;
	bool m_bStart;
	bool m_bFinish;

	scene::ISceneNode* levelScene;
	rectf floor;
	core::aabbox3df room;

public:
	IPathPlanner();

	bool PlotPathToTarget(vector2df start, vector2df target, std::list<vector3df>& path);
	void LoadLevel(scene::ISceneNode* level);
	void AddObstacle(scene::ISceneNode* node);
	void CreateGraph(int numberCellsX, int numberCellsY);
	void ProcessLevel();

	~IPathPlanner(){
		m_Path.clear();
		delete m_pGraph;
	}
};

#endif